<?php 
  	class MY_Controller extends CI_Controller{
		public $_lang = "";
		public function __construct(){
			parent::__construct();
			$this->load->library("session");
			$this->load->model("mindex");
			$this->load->model("model_categories");
			$this->_lang = $this->session->userdata("language");
            //$this->output->enable_profiler();
		}
		public function fillter($str){
			$str = str_replace("<", "&lt;", $str);
			$str = str_replace(">", "&gt;", $str);
			$str = str_replace("&", "&amp;", $str);			
			$str = str_replace("|", "&brvbar;", $str);
			$str = str_replace("~", "&tilde;", $str);
			$str = str_replace("`", "&lsquo;", $str);
			$str = str_replace("#", "&curren;", $str);
			$str = str_replace("%", "&permil;", $str);
			$str = str_replace("'", "&rsquo;", $str);
			$str = str_replace("\"", "&quot;", $str);
			$str = str_replace("\\", "&frasl;", $str);
			$str = str_replace("--", "&ndash;&ndash;", $str);
			$str = str_replace("ar(", "ar&Ccedil;", $str);
			$str = str_replace("Ar(", "Ar&Ccedil;", $str);
			$str = str_replace("aR(", "aR&Ccedil;", $str);
			$str = str_replace("AR(", "AR&Ccedil;", $str);
			return htmlspecialchars($str);
		}
		public function cut_str($str,$start,$end){
			$val = substr($str,$start,$end);
			return $val;
		}
		public function debug($val){
			echo "<pre>";
			print_r($val);
			echo "</pre>";
			die();
		}
		public function config(){
			return $this->mindex->config();
		}
        function get_menu() {
            $this->load->model("model_categories");
            return $this->model_categories->getdata_hierarchymenu(2,0);
        }
	}